#!/usr/bin/ruby -Ku
# -*- coding: utf-8 -*-
require 'test/unit'
require 'm3g'

class Test_Fog < Test::Unit::TestCase
  def setup
  end

  def teadown
  end

  def test_defualt_variables
    fog = M3G::Fog.new

    assert_equal M3G::Fog::LINEAR, fog.mode
    assert_equal 1         , fog.density
    assert_equal 0         , fog.distance.near
    assert_equal 1         , fog.distance.far
    assert_equal 0x00000000, fog.color
  end

  def test_set_variables
    fog = M3G::Fog.new
  
    fog.mode    = M3G::Fog::EXPONENTIAL
    fog.color   = 0xfc345678
    fog.density = 100
    fog.linear  = [1,10]

    assert_equal M3G::Fog::EXPONENTIAL, fog.mode
    assert_equal 100        , fog.density
    assert_equal 1          , fog.distance.near
    assert_equal 10         , fog.distance.far
    assert_equal 0x00345678 , fog.color

  end

  def test_duplicate
    fog1 = M3G::Fog.new
  
    fog1.mode    = M3G::Fog::EXPONENTIAL
    fog1.color   = 0xfc345678
    fog1.density = 100
    fog1.linear  = [1,10]

    fog2 = fog1.duplicate

    assert_equal M3G::Fog::EXPONENTIAL, fog2.mode
    assert_equal 100        , fog2.density
    assert_equal 1          , fog2.distance.near
    assert_equal 10         , fog2.distance.far
    assert_equal 0x00345678 , fog2.color
  end
end

